package com.test.demo;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @ClassName FindMaxMath
 * @Description TODO
 * @Author DouWeiWei
 * @Date 2020/10/22 17:02
 */
public class FindMaxMath {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<Integer>();
        list.add(1);
        list.add(5);
        list.add(3);
        list.add(2);
        List<Integer> collect = list.stream().sorted().collect(Collectors.toList());
        System.out.println(collect);
        System.out.println(list);
        Integer max = Collections.max(collect);
        System.out.println(max);

        int a = 0;
        for (int i = 0; i < list.size(); i++) {
            a++;
            System.out.println(a);
        }

    }
}
